 SET(CMAKE_CXX_FLAGS_DEBUG " $ENV{CXXFLAGS} -std=c++11 -DDEBUG -DUSE_CUDA -DDLIB_NO_GUI_SUPPORT -g  -w")
SET(CMAKE_CXX_FLAGS_RELEASE " $ENV{CXXFLAGS} -std=c++11 -DNDEBUG -DUSE_CUDA -DDLIB_NO_GUI_SUPPORT -O3 -w")

FILE(GLOB_RECURSE TEST_SRC_FILES  *.c *.cc *.cpp)

foreach(test_src ${TEST_SRC_FILES})
    GET_FILENAME_COMPONENT(ONE_TEST_TARGET ${test_src} NAME_WE)
    CUDA_ADD_EXECUTABLE(${ONE_TEST_TARGET} ${test_src})
    TARGET_LINK_LIBRARIES(${ONE_TEST_TARGET} ${PROJECT_NAME} ${CUDA_LIBRARIES} ${OpenCV_LIBS})
endforeach(test_src)